/*
 * Pgen.cpp
 *
 *  Created on: Jan 25, 2012
 *      Author: The Almighty Eric
 */

#include "PGen.h"

/*PGen::PGen(int x, int y, int w, int h, float freq, int n, Particle p)
{
	this.x = x;
	this.y = y;
	this.w = w;
	this.h = h;
	numperint = n;
	this.freq = freq;
	this.p = p;

	parts = new std::list<Particle>();
	parts.clear();

}*/

void PGen::updatecoords(int x, int y)
{/*
	this.x = x;
	this.y = y;*/
}

void PGen::generate()
{
	for(int i = 0; i < numperint; i++)
	{
		//Pick a random x y coord within the area
		int rx, ry;
		rx = rand() % w;
		ry = rand() % h;
		rx += x;
		ry += y;

		p.x = rx;
		p.y = ry;

		//Create new particle at point x y
		parts.push_back(p);
	}

}

void PGen::update(Uint32 ticks)
{
	std::list<Particle>::iterator it = parts.begin();

	/*while(parts)
	{

	}*/
}
